package cn.wolfcode.wolf2w.controller;

import cn.wolfcode.wolf2w.util.UploadUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import java.util.HashMap;
import java.util.Map;

@Controller
public class UploadController {

    /*
    *图片存贮
    * */
    @RequestMapping("coverImageUpload")
    @ResponseBody
    public Object uploadImg(MultipartFile pic) throws Exception {
        //保存图片
        String path = UploadUtil.uploadAli(pic);

        return path;  //放回图片存贮路径.
    }


}
